package com.bear.hospital.utils;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author： zmwx
 * @Date： 2025/2/11 10:24
 * @Describe：
 */
    @Configuration
    public class WebConfig implements WebMvcConfigurer {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/**") // 指定路径下的所有请求
                    .allowedOrigins("http://localhost:8080", "http://localhost:8089")
                    .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS");
        }
}
